include( 'shared.lua' )


// Clientside only stuff goes here
function set_team()
function GM:PlayerJoinTeam( ply, teamid )
	if ply:Team() == team_1 and teamid == team_2 --
		return false
	elseif ply:Team() == team_4 and teamid == team_2
		return false
		else
		return true
	end
end
 
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrW() / 2, ScrH() / 2 )
frame:SetSize( 200, 210 ) 
frame:SetTitle( "Change Team" ) 
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
 
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 ) 
team_1:SetSize( 50, 100 )
team_1:SetText( "VIP Protection Force" )
team_1.DoClick = function() 
    RunConsoleCommand( "team_1" )
end
 
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( frame:GetTall() / 2, 105 ) 
team_2:SetSize( 50, 100 )
team_2:SetText( "VIP" )
team_2.DoClick = function() 
	RunConsoleCommand( "team_2" )
	
end

team_3 = vgui.Create( "DButton", frame )
team_3:SetPos( frame:GetTall() / 2, 105 ) 
team_3:SetSize( 50, 100 )
team_3:SetText( "Terrorist" )
team_3.DoClick = function() 
    RunConsoleCommand( "team_3" )
end

team_4 = vgui.Create( "DButton", frame )
team_4:SetPos( frame:GetTall() / 2, 105 ) 
team_4:SetSize( 50, 100 )
team_4:SetText( "Spectator" )
team_4.DoClick = function() 
    RunConsoleCommand( "team_4" )
end
 
end
concommand.Add( "team_menu", set_team )
 